<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j"	
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<ui:composition template="/template.jsp">

	<ui:define name="titulo"> <h:outputLabel value="#{msgs['tela.incluirUsuario']}" /> </ui:define>
		<ui:define name="corpo">
			<h:form id="frm">
				<rich:panel header="#{msgs['tela.incluirUsuario']}">
					<h:panelGrid columns="2">

						<h:outputLabel value="#{msgs['label.usuario']}" />
						<h:panelGroup>
							<h:inputText id="usuario" size="40" maxlength="50" value="#{usuarioController.usuario.usuario}" required="true" requiredMessage="Campo obrigatório"  label="Usuário:" >
								<f:validator validatorId="nomeUsuarioValidator"/>
							</h:inputText>
							<rich:message id="usuarioMessage" for="usuario" ajaxRendered="true" errorClass="rf-msg-err"/>
							
						</h:panelGroup>
						<h:outputLabel value="#{msgs['label.nomeUsuario']}" />
						<h:panelGroup>
							<h:inputText id="nome" size="40" maxlength="100" value="#{usuarioController.usuario.nome}" required="true" requiredMessage="Campo obrigatório" label="Nome:">
							</h:inputText>
							<rich:message for="nome" ajaxRendered="true" errorClass="rf-msg-err"/>
							
						</h:panelGroup>
	
						<h:commandButton value="#{msgs['button.salvar']}"	action="#{usuarioController.salvar}" />
						<h:commandButton value="#{msgs['button.cancelar']}"	action="#{usuarioController.listar}" type="button" immediate="true"/>
	
					</h:panelGrid>
				</rich:panel>
			</h:form>
		</ui:define>
	</ui:composition>

</html>